home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LT_UpdateStrings.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  2KB  |  93 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. STATIC VOID
  17. LTP_UpdateStrings(ObjectNode *Group)
  18. {
  19.     ObjectNode    *Node;
  20.     ULONG         Page;
  21.  
  22.     SCANPAGE(Group,Node,Page)
  23.     {
  24.         switch(Node->Type)
  25.         {
  26.             case FRACTION_KIND:
  27.             case PASSWORD_KIND:
  28.             case STRING_KIND:
  29.             case INTEGER_KIND:
  30.  
  31.                 if(Node->Host)
  32.                     LTP_PutStorage(Node);
  33.  
  34.                 break;
  35.  
  36.             #ifdef DO_TEXTEDIT_KIND
  37.             {
  38.                 case TEXTEDIT_KIND:
  39.  
  40.                     if(Node->Host != NULL)
  41.                         LTP_PutStorage(Node);
  42.  
  43.                     break;
  44.             }
  45.             #endif /* DO_TEXTEDIT_KIND */
  46.  
  47.             case GROUP_KIND:
  48.  
  49.                 LTP_UpdateStrings(Node);
  50.                 break;
  51.         }
  52.     }
  53. }
  54.  
  55. /****** gtlayout.library/LT_UpdateStrings ******************************************
  56. *
  57. *   NAME
  58. *    LT_UpdateStrings -- Make sure all visible string buffer contents
  59. *                        get written into storage (v9).
  60. *
  61. *   SYNOPSIS
  62. *    LT_UpdateStrings(LayoutHandle);
  63. *                            A0
  64. *
  65. *    VOID LT_UpdateStrings(struct LayoutHandle *);
  66. *
  67. *   FUNCTION
  68. *    The user can terminate input into a string gadget or an object
  69. *    derived from a string gadget by various means. They all have
  70. *    in common that the application receives no notification that
  71. *    the string gadget contents have changed. This is particularly
  72. *    nasty with objects which make use of LA_STRPTR or other
  73. *    tags. Using LT_UpdateStrings() you can force all visible string
  74. *    gadget objects to hand over their contents to the internal
  75. *    buffers. Do this before you eventually exit your input loop.
  76. *
  77. *   INPUTS
  78. *    LayoutHandle - Pointer to LayoutHandle structure.
  79. *
  80. *   RESULT
  81. *    none
  82. *
  83. ******************************************************************************
  84. *
  85. */
  86.  
  87. VOID LIBENT
  88. LT_UpdateStrings(REG(a0) LayoutHandle *Handle)
  89. {
  90.     if(Handle)
  91.         LTP_UpdateStrings(Handle->TopGroup);
  92. }
  93.